﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace com.hk.validate.Common
{
    public class DataTypeValidator : IValidate
    {
        public DataTypeValidator(object toValidate,Type type)
        {
            this.Type = type;
            this.ToValidate = toValidate;
        }        

        public bool Validate()
        {            
            if(this.ToValidate != null && this.ToValidate.GetType().Equals(this.Type))
            {
                return true;
            }
            return false;
        }

        public Type Type { get;  set; }
        public object ToValidate { get; set; }
    }
}
